/*
 *Copyright (c) 2024 Black Sesame Technologies
 *
 *Licensed under the Apache License, Version 2.0 (the "License");
 *you may not use this file except in compliance with the License.
 *You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 *Unless required by applicable law or agreed to in writing, software
 *distributed under the License is distributed on an "AS IS" BASIS,
 *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *See the License for the specific language governing permissions and
 *limitations under the License.
*/

#ifndef PLATFORM_TYPES_H
#define PLATFORM_TYPES_H

/**********************************************************************************************************************
 * INCLUDES
 *********************************************************************************************************************/
 
/**********************************************************************************************************************
 *  GLOBAL CONSTANT MACROS
 *********************************************************************************************************************/

/* R20-11 */
#define PLATFORM_AR_RELEASE_MAJOR_VERSION       20
#define PLATFORM_AR_RELEASE_MINOR_VERSION       11


/* The platform type files for all platforms could contain the following symbols */
#define CPU_TYPE_8            8u
#define CPU_TYPE_16           16u
#define CPU_TYPE_32           32u
#define CPU_TYPE_64           64u
#define MSB_FIRST             0u
#define LSB_FIRST             1u
#define HIGH_BYTE_FIRST       0u
#define LOW_BYTE_FIRST        1u

#ifndef TRUE
   #define TRUE   1u
#endif

#ifndef FALSE
   #define FALSE  0u
#endif

#ifndef Enable
   #define Enable   1u
#endif

#ifndef Disable
   #define Disable  0u
#endif

#ifndef NULL
  #define NULL   0u
#endif

#ifndef BIT
    #define BIT(x)  (1UL << (x))
#endif

/* The platform types for A1000 could have the following mapping to the ANSI C types */
#define CPU_TYPE           CPU_TYPE_32
#define CPU_BIT_ORDER      LSB_FIRST
#define CPU_BYTE_ORDER     LOW_BYTE_FIRST

#define BST_COMPONENT_IS_READY     0x11111111U  /**< In device drivers, This macro will be
                                                 assigend to "IsReady" member of driver
												 instance to indicate that driver
												 instance is initialized and ready to use. */
#define BST_COMPONENT_IS_STARTED   0x22222222U  /**< In device drivers, This macro will be assigend to
                                                 "IsStarted" member of driver instance
												 to indicate that driver instance is
												 started and it can be enabled. */
                      
/**********************************************************************************************************************
 *  GLOBAL FUNCTION MACROS
 *********************************************************************************************************************/



/**********************************************************************************************************************
 *  GLOBAL DATA TYPES AND STRUCTURES
 *********************************************************************************************************************/
typedef unsigned char      boolean;          /* SWS_Platform_00026 ---                 TRUE .. FALSE                 */

typedef unsigned char      uint8;            /* SWS_Platform_00013 ---                    0 .. 255                   */
typedef unsigned short     uint16;           /* SWS_Platform_00014 ---                    0 .. 65535                 */
typedef unsigned long      uint32;           /* SWS_Platform_00015 ---                    0 .. 4294967295            */
typedef signed char        sint8;            /* SWS_Platform_00016 ---                 -128 .. +127                  */
typedef signed short       sint16;           /* SWS_Platform_00017 ---               -32768 .. +32767                */
typedef signed long        sint32;           /* SWS_Platform_00018 ---          -2147483648 .. +2147483647           */
typedef unsigned long long uint64;           /* SWS_Platform_00066 ---                    0 .. 18446744073709551615  */
typedef signed long long   sint64;           /* SWS_Platform_00067 --- -9223372036854775808 .. 9223372036854775807   */

typedef unsigned int       uint8_least;      /* SWS_Platform_00020 --- At least 8 bit                 */
typedef unsigned int       uint16_least;     /* SWS_Platform_00021 --- At least 16 bit                */
typedef unsigned long      uint32_least;     /* SWS_Platform_00022 --- At least 32 bit                */
typedef signed int         sint8_least;      /* SWS_Platform_00023 --- At least 7 bit + 1 bit sign    */
typedef signed int         sint16_least;     /* SWS_Platform_00024 --- At least 15 bit + 1 bit sign   */
typedef signed long        sint32_least;     /* SWS_Platform_00025 --- At least 31 bit + 1 bit sign   */

typedef float              float32;          /* SWS_Platform_00041 */
typedef double             float64;          /* SWS_Platform_00042 */


typedef void*              VoidPtr;          /* SWS_Platform_91001 --- This type shall be used for buffers that contain data returned to the caller */
typedef const void*        ConstVoidPtr;     /* SWS_Platform_91002 --- This type shall be used for buffers that are passed to the callee */


/**********************************************************************************************************************
 *  GLOBAL DATA PROTOTYPES
 *********************************************************************************************************************/

 
/**********************************************************************************************************************
 *  GLOBAL FUNCTION PROTOTYPES
 *********************************************************************************************************************/

 
#endif  /* PLATFORM_TYPES_H */

/**********************************************************************************************************************
 *  END OF FILE: Platform_Types.h
 *********************************************************************************************************************/
